xilinx: zynqmp: Read bootmode register using PM API
authorSiva Durga Prasad Paladugu <[email protected]>
Mon, 20 Feb 2017 12:25:50 +0000 (17:55 +0530)
committerSiva Durga Prasad Paladugu <[email protected]>
Thu, 17 May 2018 09:42:08 +0000 (15:12 +0530)
Read boot mode register using pm_mmio_read if pmu is
present otherwise access it directly using mmio_read_32().

Signed-off-by: Siva Durga Prasad Paladugu <[email protected]>
Acked-by: Michal Simek <[email protected]>
plat/xilinx/zynqmp/aarch64/zynqmp_common.c

index fd054beb9450b08eaae8a6aab6db4e3eb29c9386..ace4a0a95aa2e8905cdee5190581d6b9a0c3a38b 100644 (file)
@@ -10,6 +10,7 @@
 #include <platform.h>
 #include <xlat_tables.h>
 #include "../zynqmp_private.h"
+#include "pm_api_sys.h"
 
 /*
  * Table of regions to map using the MMU.
@@ -241,7 +242,12 @@ int zynqmp_is_pmu_up(void)
 
 unsigned int zynqmp_get_bootmode(void)
 {
-       uint32_t r = mmio_read_32(CRL_APB_BOOT_MODE_USER);
+       uint32_t r;
+
+       if (zynqmp_is_pmu_up())
+               pm_mmio_read(CRL_APB_BOOT_MODE_USER, &r);
+       else
+               r = mmio_read_32(CRL_APB_BOOT_MODE_USER);
 
        return r & CRL_APB_BOOT_MODE_MASK;
 }